import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
    base: '/image/',
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src'),
            views: path.resolve(__dirname, 'src/views'),
            router: path.resolve(__dirname, 'src/router'),
            plugins: path.resolve(__dirname, 'src/plugins'),
            utils: path.resolve(__dirname, 'src/utils'),
        }
    },
    plugins: [vue()],
    server: {
        proxy: {
            '/image/api': {
                target: 'http://localhost:8080/',
                changeOrigin: true,
            },
            '^.*(.jpg|.jpeg|.png|.gif|.bmp).*': {
                target: 'http://localhost:8080/',
                changeOrigin: true,
            },
            // '/api/admin/index': {
            //     target: 'http://localhost:8080/',
            //     changeOrigin: true,
            // }
        }
    }
})
